local skel = fk.CreateSkill {
  name = "emo__moxianwang",
  tags = {Skill.Compulsory},
}

skel:addEffect(fk.AfterCardsMove, {
  anim_type = "defensive",
  can_trigger = function (self, event, target, player, data)
    if player:hasSkill(skel.name) and player:usedEffectTimes(self.name) < 100 then
      for _, move in ipairs(data) do
        if move.toArea == Player.Hand and move.to and move.to ~= player and move.to.phase ~= Player.Draw then
          return true
        end
      end
    end
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    room:recover { num = 1, skillName = skel.name, who = player, recoverBy = player }
    if not player.dead then
      room:changeMaxHp(player, 1)
    end
  end,
})

skel:addEffect(fk.HpRecover, {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    return target ~= player and player:hasSkill(skel.name) and player:usedEffectTimes(self.name) < 100
  end,
  on_use = function (self, event, target, player, data)
    player:drawCards(1, skel.name)
    player.room:addPlayerMark(player, MarkEnum.AddMaxCards)
  end,
})


Fk:loadTranslationTable{
  ["emo__moxianwang"] = "魔仙王",
  [":emo__moxianwang"] = "锁定技，①其他角色于摸牌阶段外获得牌后，你恢复一点体力并增加一点体力上限；②其他角色回复体力后，你摸一张牌并增加一点手牌上限。",
}


return skel
